How to get objects Created on date as well as time?

Hello,

How can I get objects Created On date as well as time? I have tried following code but it is only producing a date.
Object o=current
string d=o."Created On"
//Date d=o."Created On"
print d
//Give me with time

Is there a way to get both date and time for created On attribute? 

 


Mayur Chaudhari - Tue Dec 12 01:46:28 EST 2017

Re: How to get objects Created on date as well as time?
Mayur Chaudhari - Wed Dec 13 23:36:53 EST 2017

Anybody know this please help.

Thank you

Re: How to get objects Created on date as well as time?
thsturm - Thu Dec 14 06:10:49 EST 2017

As far as I know, these attributes are read-only Frown

So you must define your own attributes to store date and time.

Re: How to get objects Created on date as well as time?
Mayur Chaudhari - Thu Dec 14 08:16:50 EST 2017

thsturm - Thu Dec 14 06:10:49 EST 2017

As far as I know, these attributes are read-only Frown

So you must define your own attributes to store date and time.

Thanks for reply,

Ignore my code just tell me please how do I get date and time both for Created On Attribute in any way.

Thanks

Re: How to get objects Created on date as well as time?
smarti.sj - Thu Dec 14 09:04:16 EST 2017

Hi

If you run:

Object o=current
Date d = o."Created On"
print dateAndTime(d)

you get the date and 00:00:00 for the time, even when the object was created within the current Module version.  So, my guess is the time is not stored in the system-level Created On attribute.  My initial thoughts are that leaves some intense scripting to find out which baseline (if any) the object was created in and getting the time from the "create" history instead.

 

Sara

Re: How to get objects Created on date as well as time?
thsturm - Thu Dec 14 09:25:33 EST 2017

Sorry, I read 'set' instead of 'get'.

To get a date in a formated string I use:
 

    string ds = stringOf(dateAndTime(today), "yyyy-MM-dd HH:mm:ss")
    print ds  "\n"

and get:

2017-12-14 15:21:02

If I try to get the date and time of a 'obj."Created On"', I get only the date Goofy

It seams, that there is no time in the "Created On".

Object obj
for obj in current Module do {
        Date dd = obj."Created On"
        int di = intOf(dd) 
        print identifier obj ", " di "\n"
}

gives only:

TCC35, 1454281200
TCC36, 1454281200
TCC46, 1477954800
TCC47, 1477954800

The Dates are without Time:

Object obj
for obj in current Module do {
        Date dd = obj."Created On"
        print identifier obj " (" includesTime(dd) ")\n"
}

gives only (false)!

Re: How to get objects Created on date as well as time?
EHcnck - Thu Dec 14 11:06:47 EST 2017

thsturm - Thu Dec 14 09:25:33 EST 2017

Sorry, I read 'set' instead of 'get'.

To get a date in a formated string I use:
 

    string ds = stringOf(dateAndTime(today), "yyyy-MM-dd HH:mm:ss")
    print ds  "\n"

and get:

2017-12-14 15:21:02

If I try to get the date and time of a 'obj."Created On"', I get only the date Goofy

It seams, that there is no time in the "Created On".

Object obj
for obj in current Module do {
        Date dd = obj."Created On"
        int di = intOf(dd) 
        print identifier obj ", " di "\n"
}

gives only:

TCC35, 1454281200
TCC36, 1454281200
TCC46, 1477954800
TCC47, 1477954800

The Dates are without Time:

Object obj
for obj in current Module do {
        Date dd = obj."Created On"
        print identifier obj " (" includesTime(dd) ")\n"
}

gives only (false)!

lastModifiedTime(Object o)

Re: How to get objects Created on date as well as time?
thsturm - Thu Dec 14 11:12:00 EST 2017

Thank you for your post.

Having learnt something new.

I assume it is from the perms-list?

I didn't found this in the DXL manual.

Re: How to get objects Created on date as well as time?
EHcnck - Thu Dec 14 14:32:07 EST 2017

thsturm - Thu Dec 14 11:12:00 EST 2017

Thank you for your post.

Having learnt something new.

I assume it is from the perms-list?

I didn't found this in the DXL manual.

It;s in the manual

 

lastModifiedTime
Declaration
Date lastModifiedTime({Module|Object|Link})
Operation
Returns the date the supplied item was last modified, including the time of the modification.

Attachments

dxl_reference_manual.pdf